package com.example.xm.exception;

import com.example.xm.web.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler
    public Result handlerServiceExceptionnn(SerceiceException serceiceException){
        System.out.println("handlerServiceExceptionnn"+serceiceException);
        return Result.fail(serceiceException.getServiceCode(),serceiceException.getMessage());
    }
}
